
#ifndef SCREEN_FESTYRE_H
#define SCREEN_FESTYRE_H

#include <stdint.h>
#include <stdbool.h>

#ifdef __cpluscplus
extern "C"
{
#endif

typedef struct param_info
{
    int point_x;
    int point_y;

}param_info_t;

typedef enum SCREEN_GESTURE_TYPE
{
    //touch point is center of screen
    SCREEN_GESTURE_TOP_SWIP = 1, // swip to up
    SCREEN_GESTURE_BOTTOM_SWIP,  // swip to down
    SCREEN_GESTURE_LEFT_SWIP,    // swip to left
    SCREEN_GESTURE_RIGHT_SWIP,   // swip to right
    
    //touch point is close to screen edge 
    SCREEN_GESTURE_TOP_PULL,    //param is touch point
    SCREEN_GESTURE_BOTTOM_PULL, //param is touch point
    SCREEN_GESTURE_LEFT_PULL,   //param is touch point
    SCREEN_GESTURE_RIGHT_PULL,  //param is touch point

}SCREEN_GESTURE_TYPE_e;

//is_release is only valid for SCREEN_GESTURE_TOP_PULL ~ SCREEN_GESTURE_RIGHT_PULL
typedef void (*screen_gesture_callback)(SCREEN_GESTURE_TYPE_e type, bool is_release, param_info_t *param);
 
typedef struct trigger_condition
{
    int  swip_min_pixel;
    int  screen_height; 
    int  screen_width;
    int  pull_region_width;
    screen_gesture_callback cb;

}trigger_condition_t;

void lv_screen_gesture_init(trigger_condition_t *condition);

void lv_screen_gesture_loop(int is_press, int point_x, int point_y);


#ifdef __cpluscplus
}
#endif

#endif